'use strict';

/* Controllers */

angular.module('campusRecruitingApp')
        .controller('AppCtrl', ['$scope', '$translate', function($scope, $translate) {
    $scope.status = {
        isWhyDucOpen: false
    };
    $scope.isMiniMenu = false;
    // angular translate
    $scope.lang = { isWhyDucOpen: false };
    $scope.langs = {en:'EN', cn:'CN'};
    $scope.selectLang = $scope.langs[$translate.proposedLanguage()] || 'EN';

    $scope.toggleDropdown = function($event) {
        $event.preventDefault();
        $event.stopPropagation();
        $scope.status.isWhyDucOpen = !$scope.status.isWhyDucOpen;
    };



    $scope.toggleMiniMenu = function() {
        $scope.isMiniMenu = !$scope.isMiniMenu;
    };

    $scope.setLang = function(langKey) {
        // set the current lang
        $scope.selectLang = $scope.langs[langKey];
        // You can change the language during runtime
        $translate.use(langKey);
        $scope.lang.isWhyDucOpen = !$scope.lang.isWhyDucOpen;
    };
    
    $scope.isClickApplyNow = function(){
        $scope.applyNowIsClick = !$scope.applyNowIsClick;
    };
  }]);
